package com.woniuxy.oldmanapi.service;

import com.woniuxy.oldmanapi.entity.Recipecategory;
import com.woniuxy.oldmanapi.mapper.RecipecategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RecipeCategoryService {
    //RecipeCategoryService
    @Autowired
    RecipecategoryMapper recipecategoryMapper;

    public List<Recipecategory> initSelectAll() {
        return recipecategoryMapper.selectAll();
    }

    public void addRecipe(Recipecategory recipecategory) {
        recipecategoryMapper.insert(recipecategory);
    }

    public void modifyRecipe(Recipecategory recipecategory) {
        recipecategoryMapper.updateByPrimaryKey(recipecategory);
    }

    public void deleteRecipe(Integer id) {
        recipecategoryMapper.deleteByPrimaryKey(id);
    }

    public Recipecategory selectRecipeById(Integer id) {
        return recipecategoryMapper.selectByPrimaryKey(id);
    }
}
